import {
	request
} from './request.js'
// 2024 新接口
export const getArticle = (url, data, type) => request(url, data, 'get', type)
// 互转记录
export const reqChangeMsg = (url, data, type) => request(url, data, 'POST', type)
// 互转
export const reqChange = (url, data, type) => request(url, data, type)
// 报单选项
export const taxationSelect = (url, data) => request(url, data, 'POST')
// 版本号
export const getVersions = (url) => request(url)
// 提现明细
export const withdrawDepositDetails = (url, data) => request(url, data, 'POST')
// 忘记密码 
export const setForgetPassword = (url) => request(url)
// 首页
// 权益入口信息
export const getEquity = (url) => request(url)
// 轮播图
export const getSlideshow = (url) => request(url)
// 公告
export const getAnnouncement = (url) => request(url)
// 获取筛选列表（还未使用过）
export const getFiltrate = (url) => request(url)
// 热门商家
export const getHotMerchant = (url, data, showLoading = false) => request(url, data, 'get', showLoading)
// 首页商家分类 
// export const getBusinessClassify = (url) => request(url)
// 首页宣传轮播 
export const getPublicity = (url) => request(url)
// 报单详情页
export const getTaxationForm = (url, data, type) => request(url, data, type)
// 热门商家详情
export const getHotMerchantDetails = (url, data) => request(url, 'POST')
// 注册
export const register = (url) => request(url, 'POST')
// 登录
export const login = (url, data) => request(url, data, 'POST')
// 判断登录是否过期
export const reqLoginStatus = (url) => request(url)

// 收货地址列表
export const shippingAddress = (url) => request(url)
// 保存地址
export const saveAddress = (url, data) => request(url, data, 'POST')
// 保存地址
export const postVideoData = (url, data) => request(url, data, 'POST')
// 保存地址
export const postVideoDataNotLoading = (url, data) => request(url, data, 'POST', false)
// 设置默认地址
export const setDefaultAddress = (url, data) => request(url, data, 'POST')
// 地址详情
export const getAddressDetails = (url, data) => request(url)
// 删除地址
export const setDelAddress = (url, data) => request(url, data, 'POST')
// 商品详情
export const getCommodityDetails = (url, data) => request(url)
// 获取规格及其信息
export const getSpecification = (url, data) => request(url, data, 'POST')
// 加入购物车
export const setShoppingCart = (url, data) => request(url, data, 'POST')
// 订单详情页
export const getBuyNow = (url, data) => request(url)
// 提交订单
export const setSubmitOrder = (url, data) => request(url, data, 'POST')
// 获取支付方式
export const getPayType = (url, data) => request(url, data, 'POST')
// 立即支付
export const setImmediatePayment = (url, data) => request(url, data, 'POST')
// 立即支付
export const getOrderPayStatus = (url, data) => request(url, data, 'POST', false)
// 积分商城列表
export const setShoppingMall = (url, data) => request(url, data, 'POST')
// 积分详情
export const setShoppingDetails = (url, data) => request(url, data, 'POST')
// 积分兑换
export const setShoppingExchange = (url, data) => request(url, data, 'POST')
// 积分兑换记录
export const shoppingExchangeMsg = (url, data) => request(url, data, 'POST')
// 积分明细
export const getShoppingDetails = (url, data) => request(url, data, 'POST')
export const productZhiToLtz = (url, data) => request(url, data, 'POST')
// 积分规则
export const getIntegrationRule = (url, data) => request(url, data, 'POST')
// 积分分类
export const getIntegrationClassify = (url, data) => request(url)


// 全民持股
// 榜单
export const getMonthlyList = (url, data) => request(url)
// 赠送好友
export const giveFriends = (url, data) => request(url, data, 'POST')
// 发布需求 
export const postDemand = (url, data) => request(url, data, 'POST')
// 需求列表
export const reqDemandList = (url, data) => request(url)
// 我的发布 
export const myPositionsRelease = (url, data) => request(url, data, 'POST')
// 删除我的发布
export const delMyPositionsRelease = (url, data) => request(url, data, 'POST')
// 期权明细
// export const positionsReleaseDetails = (url,data) => request(url,data,'POST')
export const positionsReleaseDetails = (url, data) => request(url)

// 加盟服务-加盟列表
export const getTojoinMsg = (url, data) => request(url)
// 加盟服务-加盟提交
export const setJoinMsg = (url, data) => request(url, data, 'POST')
// 商家类型
export const getBusinessType = (url, data) => request(url)
// 加盟服务-获取营业执照信息
export const setBusinessLicense = (url, data) => request(url, data, 'POST')
// 加盟服务-获取费用
export const getFranchiseFee = (url, data) => request(url)

// 协议
export const getAgreement = (url, data) => request(url, data, 'POST')
// 个人中心
export const getPersonalCenter = (url, data, showLoading = false) => request(url, data, 'POST', showLoading)
// 我的余额
export const getMyBalance = (url, data) => request(url, data, 'POST')
// 我的团队
export const getMyTeam = (url, data) => request(url, data, 'POST')

// 商家登录 
export const merchantLogin = (url, data) => request(url, data, 'POST')
// 商家积分充值 
export const merchantScoreRecharge = (url, data) => request(url, data, 'POST')
// 商家积分数量
export const merchantScoreNums = (url, data) => request(url, data, 'POST')
// 商家积分明细
export const merchantScoreDetails = (url, data) => request(url, data, 'POST')
// 商家积分转赠
export const merchantScoreChange = (url, data) => request(url, data, 'POST')
// 商品列表
export const merchantGoods = (url, data) => request(url, data, 'POST')
// 商品上架下架删除
export const merchantGoodSoperate = (url, data) => request(url, data, 'POST')
// 商家订单
export const merchantOrder = (url, data) => request(url, data, 'POST')
// 商家发货
export const merchantOrderShipments = (url, data) => request(url, data, 'POST')
// 商家售后
export const merchantOrderAfterSale = (url, data) => request(url, data, 'POST')

// 购物车
export const getShoppingCar = (url, data, showLoading = false) => request(url, data, 'get', showLoading)
// 加减购物车
export const operateSubAndaddShoppingCar = (url, data) => request(url, data, 'POST')
// 删除购物车
export const delShoppingCar = (url, data) => request(url, data, 'POST')

// 商家主页商品分类
export const merchantClassify = (url, data) => request(url, data, 'POST')
// 商家商品列表
export const merchantGoodsList = (url, data) => request(url, data, 'POST')


// 抽奖 支付后是否跳转抽奖
export const haveRaffleTicket = (url, data) => request(url, data, 'POST')
// 抽奖页面数据
export const getPrizeMsg = (url, data) => request(url, data, 'POST')

export const getXydcjpagejiangpin = (url, data) => request(url, data, 'POST', false)
// 开始抽奖
export const startGetPrizeMsg = (url, data, showLoading = false) => request(url, data, 'POST', showLoading)
// 中奖记录
export const getPrizeRecord = (url, data) => request(url, data)
// 领取奖品
export const getPrize = (url, data) => request(url, data)
// 领取奖品
export const getWinprizelistnew = (url, data) => request(url, data)
// 奖品收货
export const getPrizeReceiving = (url, data) => request(url, data, 'POST')
// 追加奖品评价
export const evaluationOfPrizes = (url, data) => request(url, data, 'POST')
// 抽奖首页
export const getPrizesMsg = (url, data, ) => request(url, data)
// 奖品详情
export const getPrizesDetails = (url, data) => request(url, data)
// 抽奖点赞
export const givePrizesLike = (url, data, showLoading = false) => request(url, data, 'POST', showLoading)
// 往期内容
export const getPrizesHistoryMsg = (url, data) => request(url, data)
// 众筹抽奖页面数据
export const getcrowPrizeMsg = (url, data, showLoading = false) => request(url, data, 'GET', showLoading)
// 众筹抽奖页面数据
export const getPmdzpzg = (url, data, showLoading = false) => request(url, data, 'GET', showLoading)
// 参与记录
export const getParticipationRecord = (url, data) => request(url, data)
// 报名参加
export const crowPrizeApply = (url, data) => request(url, data, 'POST')
// 是否旋转
export const getRotate = (url, data, showLoading = false) => request(url, data, 'POST', showLoading)
// 众筹中奖列表
export const getParticipationWinning = (url, data) => request(url, data)

// 商家拼团列表
export const busGroupBooking = (url, data) => request(url, data, 'POST')
// 商家拼团详情
export const busGroupBookingDeetails = (url, data) => request(url, data)
// 商家提交订单详情
export const busGroupBookingOrderDetails = (url, data) => request(url, data)
// 商家提交团购订单
export const busGroupPlaceOrder = (url, data) => request(url, data, 'POST')
// 秒杀-今日秒杀时间段数据
export const secondKillTime = (url, data) => request(url, data)
// 当前时段秒杀商品
export const secondKillTimeGoods = (url, data) => request(url, data)
// 秒杀商品详情
export const secondKillGoodsDetails = (url, data) => request(url, data)
// 秒杀商品规格信息
export const secondKillGoodsGuiGe = (url, data) => request(url, data, 'POST')
// 秒杀提交订单页数据
export const secondKillOrderDetails = (url, data) => request(url, data, 'POST')
// 秒杀提交订单页提交
export const subSecondKillOrder = (url, data) => request(url, data, 'POST')
// 获取分享海报
export const sharePoster = (url, data) => request(url, data, 'POST')
// 排行榜
export const getRankingList = (url, data) => request(url, data)
// 关于我们
export const getAboutUs = (url, data) => request(url, data)
// 商家申请收款码
export const applyCollectionCode = (url, data) => request(url, data, 'POST')
// 商家收款码
export const moneyQrCode = (url, data) => request(url, data)
// 消息列表
export const getInformation = (url, data) => request(url, data)
// 消息列表详情
export const getInformationDetails = (url, data) => request(url, data)

//充值余额
export const topUp = (url, data) => request(url, data, 'POST')
// 扫码支付
export const scanQrCodes = (url, data, showLoading = false) => request(url, data, 'POST', showLoading)
// 扫码页面数据
export const getQrCodePageMsg = (url, data) => request(url, data)

// 我的-我的订单
export const myOrder = (url, data) => request(url, data, 'POST')
// 我的订单-取消(关闭)订单
export const closeMyOrder = (url, data) => request(url, data, 'POST')
// 我的订单-确认收货
export const confirmReceiptMyOrder = (url, data) => request(url, data, 'POST')
// 我的订单-删除订单
export const delMyOrder = (url, data) => request(url, data, 'POST')
// 我的订单-订单详情
export const myOrderDetails = (url, data) => request(url, data, 'POST')
// 我的订单-申请退款详情
export const myOrderRefundDetails = (url, data) => request(url, data, 'POST')
// 退款
export const myOrderRefund = (url, data) => request(url, data, 'POST')
// 评价
export const evaluateMyOrder = (url, data, type) => request(url, data, type)
// 商品评论
export const goodsComment = (url, data) => request(url, data, 'POST')

// 商家核销
export const busHeXiao = (url, data) => request(url, data, 'POST')

// 修改昵称
export const changeNickName = (url, data) => request(url, data, 'POST')
// 获取验证码
export const getYZM = (url, data) => request(url, data, 'POST')
// 修改手机号
export const changePhone = (url, data) => request(url, data, 'POST')
// 修改密码
export const changePwd = (url, data) => request(url, data, 'POST')
// 修改头像
export const changeHeader = (url, data) => request(url, data, 'POST')
// 注销账号
export const writeOff = (url, data) => request(url, data)

// 大淘客-淘宝分类
export const getTKClassify = (url, data) => request(url, data, 'POST')
// 大淘客-淘宝列表
export const getTaoBaoList = (url, data) => request(url, data, 'POST')
// 大淘客-淘宝商品详情
export const getTaoBaoGoodsDetails = (url, data) => request(url, data, 'POST')
// 大淘客-淘宝商品搜索
export const getTaoBaoSearch = (url, data) => request(url, data, 'POST')
// 大淘客-京东商品分类
export const getJDClassify = (url, data) => request(url, data, 'POST')
// 大淘客-京东商品(搜索 列表)
export const getJDList = (url, data) => request(url, data, 'POST')
// 大淘客-京东商品详情
export const getJDGoodsDetails = (url, data) => request(url, data, 'POST')
// 大淘客-拼多多分类
export const getPDDClassify = (url, data) => request(url, data, 'POST')
// 大淘客-拼多多(搜索 列表)
export const getPDDList = (url, data) => request(url, data, 'POST')
// 大淘客-拼多多商品详情
export const getPDDGoodsDetails = (url, data) => request(url, data, 'POST')

// 大淘客-唯品会分类-暂无
export const getWPHClassify = (url, data) => request(url, data, 'POST')
// 大淘客-唯品会列表
export const getWeiPinHuiList = (url, data) => request(url, data, 'POST')
// 大淘客-唯品会搜索
export const getWeiPinHuiSearch = (url, data) => request(url, data, 'POST')
// 大淘客-唯品会详情
export const getWeiPinHuiGoodsDetails = (url, data) => request(url, data, 'POST')

// 系统说明
export const getSystemDescription = (url, data) => request(url, data)
// 获取店铺信息
export const getStoreMsg = (url, data) => request(url, data)
// 设置店铺信息
export const setStoreMsg = (url, data) => request(url, data, 'POST')
// 获取收款账户
export const getAccount = (url, data) => request(url, data, 'POST')
// 添加收款账户
export const setAccountNumber = (url, data) => request(url, data, 'POST')
// 删除账号
export const delAccountNumber = (url, data) => request(url, data, 'POST')

// 提现
export const setWithdrawDeposit = (url, data) => request(url, data, 'POST')
// 推广记录
export const getRecordPromotion = (url, data) => request(url, data, 'POST')
// 商家首页推广商品
export const getBusnessRecommendGoods = (url, data) => request(url, data, 'POST')
// 代理登录
export const setAgencyLogin = (url, data) => request(url, data, 'POST')
// 代理列表
export const getAgencyList = (url, data) => request(url, data, 'POST')
// 代理信息
export const getAgencyMsg = (url, data) => request(url, data, 'POST')
// 会员购买信息
export const getVipMsg = (url, data) => request(url, data)
// 手机验证码
export const getVerificationCode = (url, data) => request(url, data, 'POST')
// 文章详情
export const getArticleDetails = (url, data) => request(url, data, 'POST')
// 用户订单物流 
export const getPeopleLogistics = (url, data) => request(url, data, 'POST')
// 赠泌豆
export const setGiveLiuTongZhi = (url, data) => request(url, data, 'POST')

// 赠泌豆
export const checkpaypwdRequest = (url, data) => request(url, data, 'POST')
// 商品管理
export const $get = (url, data) => request(url, data, 'get')
export const $post = (url, data) => request(url, data, 'post')

export const getAppConfig = () => {
	console.log("json")
	var promise = new Promise(function(resolve, reject) {
		try {
			var json = uni.getStorageSync('APPCONFIG')
			console.log(json)
			if (json) {
				resolve(JSON.parse(json))
			} else {
				reject();
			}
		} catch (e) {
			console.log(e)
			reject();
		}
	});

	return promise;
}

export const getAppConfigSync = () => {
	try {
		var json = uni.getStorageSync('APPCONFIG')
		if (json) {
			return JSON.parse(json)
		} else {
			return {};
		}
	} catch (e) {
		return {};
	}
}